﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ChinaGS.Lian.ModuleRemoting;

public partial class pay_train_confirm_mobile_bill : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        SysCommon.checkUserLogin();

        if (!IsPostBack)
        {            
            String cusNo = this.Request["mobile_num"];
            MobilePackage mp = RemotingClass.mobileBillCheck(cusNo);

            //测试使用
            /*MobilePackage mp = new MobilePackage();
            mp.Status = true;
            mp.StatusNo = "00";
            mp.AccpetType = "s10";
            mp.Charge = 120.0;
            mp.ReceiPay = 100.0;
            mp.AccpetTypeCN = "全球通";*/

            if(mp.Status)
            {
                    if (!mp.StatusNo.Equals("00"))
                    {
                        //测试使用
                        this.LabMessage.Text = "操作失败，原因是："+mp.Message;
                        //调整内容正式时使用
                        //this.LabMessage.Text = RemotingClass.showErrorMessage(mp.StatusNo);                        
                        PanBill.Visible = false;
                    }
                    else
                    {
                        this.LabMessage.Text = "尊敬的"+ mp.CusName +"，您是" + mp.AccpetTypeCN + "用户，您的账单信息如下：";
                        LabAccpetTypeCN.Text = mp.AccpetTypeCN;
                        LabCusName.Text = mp.CusName;
                        LabCusNo.Text = mp.CusNo;
                        if (mp.AccpetType.Equals("s10"))//全球通
                        {                           
                            //显示查询结果     
                            this.LabChargeName.Text = "本期账单";
                            this.LabCharge.Text = mp.ReceiPay.ToString();                            
                        }                     
                        else { //预付费s30 s30
                            
                            //显示查询结果            
                            this.LabChargeName.Text = "账户余额";
                            this.LabCharge.Text = mp.Charge.ToString();
                        }

                        HidAccpetType.Value = mp.AccpetType;
                        HidCharge.Value = mp.Charge.ToString();
                        HidReceiPay.Value = mp.ReceiPay.ToString();
                        HidcusNo.Value = cusNo;

                        PanBill.Visible = true;
                    }               
            }
            else
            {
                this.LabMessage.Text = "本次操作失败，错误信息是："+mp.Message+"请稍后重试！";
                //显示查询失败
                PanBill.Visible = false;
            }

        }        
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("fill_mobile.aspx?HidAccpetType=" + HidAccpetType.Value
                                    + "&HidCharge=" + HidCharge.Value.ToString()
                                    + "&HidReceiPay=" + HidReceiPay.Value.ToString()
                                    + "&HidcusNo=" + HidcusNo.Value);

    }
}
